package bank;

public class _09PalindromeInt {
    public static boolean isPalindrome(int x) {
        if(x < 0 || x>=Integer.MAX_VALUE){
            return false;
        }else if(x>=0 && x<10){
            return true;
        }
        //想一个办法把数字颠倒过来，只需要和原数x相等则是回文数
        int y=0,digit=0,mirX = x;
        while (mirX != 0){
            digit = mirX%10;
            y = y*10 + digit;
            mirX /= 10;
        }
        return y==x;
    }
}
